<style>
body {
  font: Helvetica, sans-serif;
  color: #999;
}
.logo {
  width: 40px;
  height: 40px;
}

</style>

<style scoped>
  @import '../../../assets/css/login.css';
</style>

<template>
       <div class="login">
            <div class="cancelBtn">取消</div>
            <div class="tel-code">
                <div class="tel">
                    手机号:
                    <input name="" placeholder="请输入手机号" type="number" max_length="11" v-model="utel"></div>
                <div class="code">
                    密码:
                    <input name="" placeholder="请输入密码" type="password" v-model="password">
                </div>
                <div class="bind-tip"></div>
            </div>
            <div class="bind" @click="login()">登录</div>
            <p class="agreement">注册登录即表示您同意
                <a href="/view/index/agreement.html">《米盘科技平台使用协议》</a>
            </p>
            <footer class="copyright">
                米盘科技&nbsp;©&nbsp;Copyright&nbsp;2017
            </footer>
            <div class="ewm" style="display: none;">
                <div class="content">
                    <p id="info_id">长按识别二维码关注微信公众号</p> <img src="">
                    <p class="userName"><span>请关注微信公众号 : </span></p>
                    <p class="closeEWM">[下次再关注]</p>
                </div>
            </div>
            <div id="alert-message" style="display: none;">
                <div class="alert-message-content">
                    <p class="message-title">提示</p>
                    <div class="message-text"> </div>
                    <div class="alert-message-btn">
                        <div class="alert-message-btn-ok" @click="delalert()">知道了</div>
                    </div>
                </div>
            </div>
        </div>
</template>

<script>
import $ from 'jquery'
import {showAlertDialog ,hideAlertDialog} from '../../../assets/js/head'
export default {
  data () {
    return {
        'utel':'',
        'password':''
    }
  },
    mounted() {
      
    },

   methods: {
    login:function(){
        if( !this.utel ){
            showAlertDialog('提示', '手机号码不能为空', '确认');
        } 
        if( !this.password ){
            showAlertDialog('提示', '密码不能为空', '确认');
        }
        $.ajax({
            url: "/Wjy/Login/user_login",
            type: 'POST',
            dataType: 'json',
            data:{utel:this.utel,password:this.password},
            success:function(data){
                if( data.status == 0 ){
                    showAlertDialog('', data.msg, '确认');return;
                }
                window.location.href="/Wjy/Index/index";
            }
        })






    },
    delalert:function(){
        hideAlertDialog();
    }




        
   }
    


}
</script>
